package com.aaa.dang.modules.repairs.controller;

import com.aaa.dang.common.entity.Repair;
import com.aaa.dang.common.util.ResultModel;
import com.aaa.dang.modules.repairs.service.IRepairsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * @Author: ymk
 * @Date: 2018/12/14 14:47
 * @description:处理学生报修申请
 */
@RestController
@RequestMapping("/repair")
public class RepairsController  {
    @Autowired
    private IRepairsService ser;

    /**
     * 报修审核
     * @param query
     * @return
     */

    @RequestMapping("/getAll")
    public ResultModel getAll(@RequestParam Map<String,Object> query){
        return ser.getAll(query);
    }

    /**
     * 根据id查询详情
     * @param id
     * @return
     */
    @RequestMapping("/queryById")
    public Repair queryById(int id){
        return ser.queryById(id);
    }

    /**
     * 更新状态
     * @param id
     * @param status
     * @return
     */
    @RequestMapping("/updateState")
    public ResultModel updateState(int id,int status) {
        return ser.updateState(id,status);

    }



}
